package com.android.boncen.commonFrame.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.android.boncen.commonFrame.base.Knowledge_baseFrament;

import java.util.ArrayList;

/**
 * Created by Boncen on 2017/1/21.
 */

public class Knowledge_viewpagerAdapter extends FragmentPagerAdapter {
    private ArrayList<Knowledge_baseFrament> fragments;

    public Knowledge_viewpagerAdapter(FragmentManager fm, ArrayList<Knowledge_baseFrament> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return fragments.get(position).getTitle();
    }
}
